Kazuharu Yanagimoto
September 21, 2022
take logs of all coding activity of you and your collaborators
go back to a previous version of codes
focus on the change in the codes, and detect bugs
separate things completed and under development
.git will be made.git folder.git folder in your local machine (like in the previous page) is called local repositoryFor now, forget about origin main
git clone URL_OF_REPOSITORYgit branch BRANCH_NAMEgit switch BRANCH_NAMEgit merge BRANCH_NAMEA simple suggestion is main-dev workflow
I usually merge dev into main just before the meeting with my supervisor or collaborators.
A different code is written in the same line of two branches in merging
origin/BRANCH_NAMEgit pull origin main is equivalent to git fetch origin main && git merge origin/maingit pull could return a CONFLICT!foo1.txt with a line of text (e.g. “Tortilla sin Cebolla”) and create a commitfoo1.txt with a different line of text (e.g. “Tortilla con Cebolla”) and a create a commitfoo2txt with a line of text (e.g. “Oh! How beautiful are our Emperor’s new clothes!”). Push it into origin/mainfoo2.txt with a different line of text (e.g. “But the Emperor has nothing at all on!”). Push it into origin/devfoo3.txt with a line of text (e.g. “Mountain of Mushroom”), create a commit, and push into origin/devfoo3.txt with a different line of text (e.g. “Mountain of Bumbooshoot”), create a commitOr
If you want to stage all modified files, git add .
I recommend you to delete the remote and local dev branch here.
You can specify a folder (e.g. data) with -R option dvc add -R data
data/csv folder and create a commit (say, “add foo1.csv”)You can see all the git activity (commit, merge, rebase, …)
You can reset any git activity
Introduction to Git・ Introduction to GitHub